import request from '@/utils/request'
/**
 * 菜品接口
 */
// 根据分类ID或菜品名称查询菜品
export const getDishList = (params) => {
  return request.get('/dish/list', {
    params: params
  })
}

// 获取菜品列表
export const getDish = (params) => {
  return request.get('/dish/page', {
    params: params
  })
}

// 启售、停售
export const changeStatus = (status, id) => {
  return request({
    url: '/dish/status/' + status,
    method: 'post',
    params: {
      id
    }
  })
}

// 删除菜品
export const deleteDish = (ids) => {
  return request({
    url: '/dish',
    method: 'delete',
    params: {
      ids
    }
  })
}

// 新增菜品
export const addDish = (data) => {
  return request({
    url: '/dish',
    method: 'post',
    data: data
  })
}

// 修改菜品
export const editDish = (data) => {
  return request({
    url: '/dish',
    method: 'put',
    data: data
  })
}

// 根据ID查询菜品
export const getIdDish = (id) => {
  return request({
    url: 'dish/' + id,
    method: 'get'
  })
}
